package com.dd.cloud.user.service.mechan;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dd.cloud.user.entity.mechan.MechanUser;
import com.dd.cloud.user.req.mechan.MechanUserAddReq;
import com.dd.cloud.user.req.mechan.MechanUserPageReq;
import com.dd.cloud.user.req.mechan.MechanUserUpdateReq;
import com.dd.cloud.user.res.mechan.MechanUserLoginRes;
import com.dd.cloud.user.res.mechan.MechanUserPage;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * <p>
 * 机构账号表 服务类
 * </p>
 *
 * @author czg
 * @since 2022-04-27
 */
public interface IMechanUserService extends IService<MechanUser> {
    /**
     * 机构管理员用户登录 验证码
     *
     * @param request
     * @param response
     * @param phone
     * @param code
     * @return
     */
    MechanUserLoginRes merchantUserLoginCode(HttpServletRequest request, HttpServletResponse response,
                                     String phone, String code);

    /**
     * 机构管理员用户登录 密码
     *
     * @param request
     * @param response
     * @param account
     * @param password
     * @return
     */
    MechanUserLoginRes merchantUserLoginPwd(HttpServletRequest request, HttpServletResponse response,
                                            String account, String password);

    /**
     * 机构管理员用户找回密码
     *
     * @param phone
     * @param code
     * @param pwd1
     * @param pwd2
     */
    void findMerchantUserPwd(String phone, String code, String pwd1, String pwd2);

    /**
     * 机构管理员用户修改密码
     *
     * @param oldPwd
     * @param newPwd1
     * @param newPwd2
     */
    void updateMerchantUserPwd(String oldPwd, String newPwd1, String newPwd2);

    /**
     * 分页查询机构管理员
     * @param req
     * @return
     */
    Page<MechanUserPage> getMechanUserPage(MechanUserPageReq req);


    /**
     * 添加机构管理员
     * @param req
     */
    void addMechanUser(MechanUserAddReq req);

    /**
     * 修改机构
     * @param req
     */
    void updateMechanUser(MechanUserUpdateReq req);

    /**
     * 修改单位管理员状态
     * @param id
     * @param status
     */
    void updateMechanUserStatus(Integer id, Integer status);

    /**
     * 确认手机号是否使用
     * @param phone
     */
    boolean checkPhoneUsed(String phone);

    /**
     * 机构id
     * @param mechanId
     */
    void resetAdminUserPwd(Integer mechanId);
}
